@extends('admin.admin')

@section('content')
        <!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        备案管理
        <small>商品备案</small>
        <small>添加</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 控制面板</a></li>
        <li ><a href="/admin/activity">商品备案</a></li>
        <li class="active">添加</li>
    </ol>
</section>

<!-- Main content -->
<section class="content">

    <div class="row">
        <div class="col-xs-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">e贸易商品信息添加</h3>
                    <div class="pull-right">
                        <a href="{{Route('admin.goodsEorder.index')}}" type="button" class="btn btn-block btn-success btn-xs"><i class="icon  glyphicon glyphicon glyphicon-menu-left"></i> 返回</a>
                    </div>
                </div>
                <!-- /.box-header -->
                <!-- form start -->
                {!! Form::model($goodsEorderInfo,['route'=>'admin.goodsEorder.store','class'=>'form-horizontal'])  !!}
                    {!! Form::hidden('back_url',@$_SERVER['HTTP_REFERER']) !!}
                    {!! Form::hidden('goods_sn',@$_GET['goods_sn']) !!}
                    <div class="box-body">

                        <div class="form-group @if($errors->has('goods_sn')) has-error   @endif">
                            <label class="col-sm-2 control-label" for="exampleInputEmail1">商品货号</label>
                            <div class="col-sm-3">
                            {!! Form::text('goods_sn',old('goods_sn'),array('class'=>'form-control','placeholder'=>'请填写商品货号'))!!}
                            @if($errors->has('goods_sn'))
                                <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('goods_sn')}}</label>
                            @elseif(Session::has('message'))
                                <label class="control-label" style="color: red" for="inputError"><i class="fa fa-times-circle-o" style="color: red"></i> {{Session::get('message')}}</label>
                            @endif
                            </div>

                        </div>

                        <div class="form-group @if($errors->has('goods_name')) has-error   @endif">
                            <label class="col-sm-2 control-label" for="exampleInputEmail1">商品名称</label>
                            <div class="col-sm-3">
                            {!! Form::text('goods_name',old('goods_name'),array('class'=>'form-control','placeholder'=>'请填写商品名称'))!!}
                            @if($errors->has('goods_name'))
                                <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('goods_name')}}</label>
                            @endif
                            </div>

                        </div>

                        <div class="form-group @if($errors->has('goods_spec')) has-error   @endif">
                            <label class="col-sm-2 control-label" for="exampleInputEmail1">商品规格型号</label>
                            <div class="col-sm-3">
                            {!! Form::text('goods_spec',old('goods_spec'),array('class'=>'form-control','placeholder'=>'请填写商品规格型号'))!!}
                            @if($errors->has('goods_spec'))
                                <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('goods_spec')}}</label>
                            @endif
                            </div>

                        </div>


                        <div class="form-group @if($errors->has('price')) has-error   @endif">
                            <label for="exampleInputPassword1" class="col-sm-2 control-label">备案价格</label>
                            <div class='col-sm-3'>
                                <div class="input-group">
                                    <span class="input-group-addon">￥</span>
                                    {!! Form::text('price',old('price'),array('class'=>'form-control','placeholder'=>'备案价格'))!!}
                                </div>
                                @if($errors->has('price'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('price')}}</label>
                                @endif
                            </div>
                        </div>

                        <div class="form-group @if($errors->has('ieType')) has-error   @endif">
                            <label for="charge" class="col-sm-2 control-label">进出口标志</label>
                            <div class="col-sm-3">
                                <?php $ieTypeArr = ['I'=>'进口(默认)','E'=>'出口']  ?>
                                {!! Form::select('ieType',$ieTypeArr,old('ieType'),['class'=>'form-control', 'id'=>'ieType' ])!!}
                                @if($errors->has('ieType'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('ieType')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('stockFlag')) has-error   @endif">
                            <label for="charge" class="col-sm-2 control-label">集货/备货</label>
                            <div class="col-sm-3">
                                <?php $ieTypeArr = ['2'=>'备货(默认)','1'=>'集货 ']  ?>
                                {!! Form::select('stockFlag',$ieTypeArr,old('stockFlag'),['class'=>'form-control', 'id'=>'stockFlag' ])!!}
                                @if($errors->has('stockFlag'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('stockFlag')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('batchNumbers')) has-error   @endif">
                            <label for="charge" class="col-sm-2 control-label">批次号(必填)</label>
                            <div class="col-sm-3">
                                {!! Form::text('batchNumbers',old('batchNumbers'),array('class'=>'form-control','placeholder'=>'批次号'))!!}
                                @if($errors->has('batchNumbers'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('batchNumbers')}}</label>
                                @endif
                            </div>
                        </div>

                        <div class="form-group @if($errors->has('tradeCountryCiq')) has-error   @endif">
                            <label for="charge" class="col-sm-2 control-label">贸易国别（检)(必填)</label>
                            <div class="col-sm-3">
                            <?php $countryCiqArr = config('goods-etouch-setting.countryCiq');  ?>
                                {!! Form::select('tradeCountryCiq',$countryCiqArr,'410',array('class'=>'form-control select2','placeholder'=>'贸易国别（检)(必填)'))!!}

                            @if($errors->has('tradeCountryCiq'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('tradeCountryCiq')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('tradeCountryCus')) has-error   @endif">
                            <label for="tradeCountryCus" class="col-sm-2 control-label">贸易国别（关)(必填)</label>
                            <div class="col-sm-3">
                            <?php $countryCusArr = config('goods-etouch-setting.countryCus');  ?>
                                {!! Form::select('tradeCountryCus',$countryCusArr,'133',array('class'=>'form-control select2','placeholder'=>'贸易国别（关)'))!!}
                            @if($errors->has('tradeCountryCus'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('tradeCountryCus')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('packageTypeCiq')) has-error   @endif">
                            <label for="charge" class="col-sm-2 control-label">包装种类(检)(必填)</label>
                            <div class="col-sm-3">
                            <?php $packageTypeCiqArr = config('goods-etouch-setting.packageTypeCiq'); ?>
                                {!! Form::select('packageTypeCiq',$packageTypeCiqArr,old('packageTypeCiq'),array('class'=>'form-control select2','placeholder'=>'包装种类(检)'))!!}
                                @if($errors->has('packageTypeCiq'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('packageTypeCiq')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('packageTypeCus')) has-error   @endif">
                            <label for="charge" class="col-sm-2 control-label">包装种类(关)(必填)</label>
                            <div class="col-sm-3">
                            <?php $packageTypeCusArr = config('goods-etouch-setting.packageTypeCus'); ?>
                                {!! Form::select('packageTypeCus',$packageTypeCusArr,old('packageTypeCus'),array('class'=>'form-control select2','placeholder'=>'包装种类(关)'))!!}
                                @if($errors->has('packageTypeCus'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('packageTypeCus')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('currencyCiq')) has-error   @endif">
                            <label for="charge" class="col-sm-2 control-label">币制（检）(必填)</label>
                            <div class="col-sm-3">
                                <?php $currencyCiqArr = config('goods-etouch-setting.currencyCiq'); ?>
                                {!! Form::select('currencyCiq',$currencyCiqArr,old('currencyCiq'),['class'=>'form-control select2', 'id'=>'currencyCiq' ])!!}
                                @if($errors->has('currencyCiq'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('currencyCiq')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('currencyCus')) has-error   @endif">
                            <label for="charge" class="col-sm-2 control-label">币制（关）(必填)</label>
                            <div class="col-sm-3">
                                <?php $currencyCusArr = config('goods-etouch-setting.currencyCus');?>
                                {!! Form::select('currencyCus',$currencyCusArr,old('currencyCiq'),['class'=>'form-control', 'id'=>'currencyCus' ])!!}
                                @if($errors->has('currencyCus'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('currencyCus')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('unitCiq')) has-error   @endif">
                            <label for="charge" class="col-sm-2 control-label">计量单位（检）(必填)</label>
                            <div class="col-sm-3">
                            <?php $unitCiqArr = config('goods-etouch-setting.unitCiq');  ?>
                                {!! Form::select('unitCiq',$unitCiqArr,old('unitCiq'),array('class'=>'form-control select2','placeholder'=>'计量单位（检）'))!!}
                                @if($errors->has('unitCiq'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('unitCiq')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('unitCus')) has-error   @endif">
                            <label for="unitCus" class="col-sm-2 control-label">计量单位（关）(必填)</label>
                            <div class="col-sm-3">
                            <?php $unitCusArr = config('goods-etouch-setting.unitCus');  ?>
                                {!! Form::select('unitCus',$unitCusArr,old('unitCus'),array('class'=>'form-control select2','placeholder'=>'计量单位（关）'))!!}
                                @if($errors->has('unitCus'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('unitCus')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('originCountryCiq')) has-error   @endif">
                            <label for="originCountryCiq" class="col-sm-2 control-label">原产国（检）(必填)</label>
                            <div class="col-sm-3">
                             <?php $countryCiqArr = config('goods-etouch-setting.countryCiq')  ?>
                                {!! Form::select('originCountryCiq',$countryCiqArr,'410',array('class'=>'form-control select2','placeholder'=>'原产国（检）(必填)'))!!}

                            @if($errors->has('originCountryCiq'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('originCountryCiq')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('originCountryCus')) has-error   @endif">
                            <label for="originCountryCus" class="col-sm-2 control-label">原产国（关)(必填)</label>
                            <div class="col-sm-3">
                            <?php $countryCusArr = config('goods-etouch-setting.countryCus'); ?>
                                {!! Form::select('originCountryCus',$countryCusArr,'133',array('class'=>'form-control select2','placeholder'=>'原产国（关)'))!!}
                                @if($errors->has('originCountryCus'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('originCountryCus')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('weight')) has-error   @endif">
                            <label for="weight" class="col-sm-2 control-label">毛重(KG)(必填)</label>
                            <div class="col-sm-3">
                                {!! Form::text('weight',old('weight'),array('class'=>'form-control','placeholder'=>'毛重(KG)'))!!}
                                @if($errors->has('weight'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('weight')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('transportationWay')) has-error   @endif">
                            <label for="transportationWay" class="col-sm-2 control-label">运输方式（检）(必填)</label>
                            <div class="col-sm-3">
                                <?php $transportationWayArr = config('goods-etouch-setting.transportationWay'); ?>

                                {!! Form::select('transportationWay',$transportationWayArr,old('transportationWay'),['class'=>'form-control', 'id'=>'transportationWay' ])!!}

                                @if($errors->has('transportationWay'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('transportationWay')}}</label>
                                @endif
                            </div>
                        </div>
                        <div class="form-group @if($errors->has('shipCode')) has-error   @endif">
                            <label for="shipCode" class="col-sm-2 control-label">运输工具（检）(必填)</label>
                            <div class="col-sm-3">
                                <?php $shipCodeArr = config('goods-etouch-setting.shipCode');?>

                                {!! Form::select('shipCode',$shipCodeArr,old('shipCode'),['class'=>'form-control', 'id'=>'shipCode' ])!!}

                                @if($errors->has('shipCode'))
                                    <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('shipCode')}}</label>
                                @endif
                            </div>
                        </div>

                        <div class="form-group @if($errors->has('goods_desc')) has-error   @endif">
                            <label class="col-sm-2 control-label" for="exampleInputEmail1">商品描述</label>
                            <div class="col-sm-3">
                            {!! Form::text('goods_desc',old('goods_desc'),array('class'=>'form-control','placeholder'=>'请填写商品描述'))!!}
                            @if($errors->has('goods_desc'))
                                <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('goods_desc')}}</label>
                            @endif
                            </div>
                        </div>

                        <div class="form-group @if($errors->has('storeInfo')) has-error   @endif">
                            <label class="col-sm-2 control-label" for="exampleInputEmail1">库位</label>
                            <div class="col-sm-3">
                            {!! Form::text('storeInfo',old('storeInfo'),array('class'=>'form-control','placeholder'=>'请填写库位'))!!}
                            @if($errors->has('storeInfo'))
                                <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('storeInfo')}}</label>
                            @endif
                            </div>
                        </div>

                        <div class="form-group @if($errors->has('net_weight')) has-error   @endif">
                           <label for="net_weight" class="col-sm-2 control-label">净重(KG)(必填)</label>
                           <div class="col-sm-3">
                               {!! Form::text('net_weight',@$goodsEorderInfo->net_weight,array('class'=>'form-control','placeholder'=>'净重(KG)'))!!}
                               @if($errors->has('net_weight'))
                                   <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('net_weight')}}</label>
                               @endif
                           </div>
                        </div>

                        <div class="form-group @if($errors->has('item_record_no')) has-error   @endif">
                            <label class="col-sm-2 control-label" for="exampleInputEmail1">海关备案编号(必填)</label>
                            <div class="col-sm-3">
                            {!! Form::text('item_record_no',old('item_record_no'),array('class'=>'form-control','placeholder'=>'请填写海关备案编号'))!!}
                            @if($errors->has('item_record_no'))
                                <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('item_record_no')}}</label>
                            @endif
                            </div>
                        </div>

                        <div class="form-group @if($errors->has('gcode')) has-error   @endif">
                            <label class="col-sm-2 control-label" for="exampleInputEmail1">HS编码(必填)</label>
                            <div class="col-sm-3">
                            {!! Form::text('gcode',old('gcode'),array('class'=>'form-control','placeholder'=>'HS编码'))!!}
                            @if($errors->has('gcode'))
                                <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('gcode')}}</label>
                            @endif
                            </div>
                        </div>

                        <div class="form-group @if($errors->has('fir_proportion')) has-error   @endif">
                           <label for="fir_proportion" class="col-sm-2 control-label">法定第一数量比例(必填)</label>
                           <div class="col-sm-3">
                               {!! Form::text('fir_proportion',@$goodsEorderInfo->fir_proportion,array('class'=>'form-control','placeholder'=>'法定第一数量比例'))!!}
                               @if($errors->has('fir_proportion'))
                                   <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('fir_proportion')}}</label>
                               @endif
                           </div>
                        </div>

                        <div class="form-group @if($errors->has('unitCus1')) has-error   @endif">
                           <label for="charge" class="col-sm-2 control-label">法定第一计量单位(必填)</label>
                           <div class="col-sm-3">
                           <?php $unitCus1Arr = config('goods-etouch-setting.unitCus')  ?>
                               {!! Form::select('unitCus1',@$unitCus1Arr,@$goodsEorderInfo->unitCus1,array('class'=>'form-control select2','placeholder'=>'法定第一计量单位'))!!}
                               @if($errors->has('unitCus1'))
                                   <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('unitCus1')}}</label>
                               @endif
                           </div>
                        </div>

                        <div class="form-group @if($errors->has('sec_proportion')) has-error   @endif">
                           <label for="sec_proportion" class="col-sm-2 control-label">法定第二数量比例</label>
                           <div class="col-sm-3">
                               {!! Form::text('sec_proportion',@$goodsEorderInfo->sec_proportion,array('class'=>'form-control','placeholder'=>'法定第二数量比例'))!!}
                               @if($errors->has('sec_proportion'))
                                   <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('sec_proportion')}}</label>
                               @endif
                           </div>
                        </div>

                        <div class="form-group @if($errors->has('unitCus2')) has-error   @endif">
                           <label for="charge" class="col-sm-2 control-label">法定第二计量单位</label>
                           <div class="col-sm-3">
                           <?php $unitCus1Arr = config('goods-etouch-setting.unitCus')  ?>
                               {!! Form::select('unitCus2',@$unitCus1Arr,@$goodsEorderInfo->unitCus2,array('class'=>'form-control select2','placeholder'=>'法定第二计量单位'))!!}
                               @if($errors->has('unitCus2'))
                                   <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('unitCus2')}}</label>
                               @endif
                           </div>
                        </div>

                        <div class="form-group @if($errors->has('usage')) has-error   @endif">
                           <label for="charge" class="col-sm-2 control-label">用途编号</label>
                           <div class="col-sm-3">
                           <?php $unitCus1Arr = config('goods-etouch-setting.usage')  ?>
                               {!! Form::select('usage',@$unitCus1Arr,@$goodsEorderInfo->usage,array('class'=>'form-control select2','placeholder'=>'用途编号'))!!}
                               @if($errors->has('usage'))
                                   <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> {{$errors->first('usage')}}</label>
                               @endif
                           </div>
                        </div>

                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                        <div class="form-group no-padding">
                            <label class="col-sm-2 control-label">&nbsp;</label>
                            <div class="col-sm-3">
                                <button type="submit" class="btn btn-primary">保存</button>
                            </div>
                        </div>
                    </div>
                {!! Form::close()  !!}
            </div>
            <!-- /.box -->
        </div>
    </div>



</section>
<!-- /.content -->

<!-- Select2 -->
<script type="text/javascript" src="{{ asset("/components/AdminLTE/plugins/select2/select2.full.min.js") }}"></script>
<script>
//Initialize Select2 Elements
$(".select2").select2();

</script>
@endsection